<template>
    <div class="suggest">
         <div class="head">
            <van-nav-bar
            title="意见反馈"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            />
        </div>
        <div class="contentbox">
            <div class="title">意见反馈</div>
            <van-cell class="message">
                <van-field
                    v-model="message"
                    rows="4"
                    autosize
                    label="留言"
                    type="textarea"
                    maxlength="150"
                    placeholder="请填写你的意见和反馈"
                    show-word-limit
                    />
            </van-cell>
            <van-cell>
                <van-field v-model="tel" type="tel" label="联系方式" />
            </van-cell>
            <div class="btn" @click="submit">提交</div>
        </div>
    </div>
</template>

<script>

    import {FsubmitAction} from '@/api/suggest'
    export default {
        data() {
            return {
                message:'',
                tel:''
            }
        },
        methods: {
            onClickLeft(){
                this.$router.go(-1);
            },
            submit(){
                const data={
                    content:this.message,
                    phone:this.tel,
                    openId:localStorage.getItem('openId'),
                    name:localStorage.getItem('nickname')
                }

                FsubmitAction(data)
                .then((res) => {
                    console.log(res);
                })
            }
        },
    }
</script>

<style lang="scss" scoped>
.head {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9;
}
.contentbox {
    margin-top: 50px;
    height: 100vh;
    background-color: #fff;
}
.title{
    padding: 10px 0;
    border-bottom: 1Px solid #d9d9d9;
    text-align: left;
    text-indent: 2em;
}
.message{
    border-bottom: 1px solid #d9d9d9;
}
.btn{
    text-align: center;
    width: 95%;
    height: 50px;
    border-radius: 50px;
    line-height: 50px;
    background: #b4282d;
    color: #fff;
    font-size: 16px;
    margin: 50px auto 0 auto;
}
</style>